/**
 * Created by wzh on 2016/8/16.
 */
swan_pc.config(
    function($stateProvider){
        $stateProvider
            .state('businessInfo', {
                parent:'site',
                //'abstract':true,
                url:'/business',
                views:{
                    'content@':{
                        templateUrl:'scripts/components/MyOrganization/businessInfo/businessInfo.html',
                        controller:'BusinessInfoController'
                    }
                }
            })
    })
    .config(
        function($stateProvider){
            $stateProvider
                .state('businessContactManage', {
                    parent:'businessInfo',
                    url:'/contact',
                    views:{
                        'detail@businessInfo':{
                            templateUrl:'scripts/components/MyOrganization/businessInfo/businessContactManage/businessContactManage.html',
                            controller:"BusinessContactManageController"
                        }
                    }
                })
        })
    .config(
        function($stateProvider){
            $stateProvider
                .state('businessCompanyManage', {
                    parent:'businessInfo',
                    url:'/company',
                    views:{
                        'detail@businessInfo':{
                            templateUrl:'scripts/components/MyOrganization/businessInfo/businessCompanyManage/businessCompanyManage.html',
                            controller:"BusinessCompanyManageController"
                        }
                    }
                })
        })
    .config(
        function($stateProvider){
            $stateProvider
                .state('businessOpportunityManage', {
                    parent:'businessInfo',
                    url:'/opp',
                    views:{
                        'detail@businessInfo':{
                            templateUrl:'scripts/components/MyOrganization/businessInfo/businessOpportunityManage/businessOpportunityManage.html',
                            controller:"BusinessOpportunityManageController"
                        }
                    }
                })
        })
    .filter('isLink', function() {
        return function(str) {
            if(str) {
                if (str.indexOf("^") >= 0)
                    return false;
                else
                    return true;
            }
            return false;
        };
    })
    .filter('validateLinkStr', function() {
        return function(str) {
            if(str) {
                if (str.indexOf("^") >= 0)
                    return str.substr(1);
            }
            return str;
        };
    })